Skip to content

fix: collect script tags nested under html/head/body - #14

Merged
Kikobeats merged 1 commit into
masterfrom
cursor/critical-bug-management-599a
Jul 30, 2026
Merged

fix: collect script tags nested under html/head/body#14
Kikobeats merged 1 commit into
masterfrom
cursor/critical-bug-management-599a

Conversation

@cursor

@cursor cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Only top-level himalaya nodes were filtered for tagName === 'script'. Normal documents like <html><head>…</head><body><script src=…> returned an empty array, so callers silently missed every nested script.

Embed snippets with sibling top-level <script> tags still worked, which hid the bug in existing tests.

Fix

Walk the AST and collect every script element, then map attributes as before.

Validation

  • Added a nested html/head/body regression test
  • Existing embed snapshot tests still pass
  • npm test: 4/4 passed at 100% coverage
Open in Web View Automation 

Only top-level AST nodes were filtered, so normal documents like
<html><body><script> returned no scripts. Walk the himalaya tree so every
script element is returned.

Co-authored-by: kikohumanbeatbox <kikohumanbeatbox@gmail.com>
@cursor
cursor Bot marked this pull request as ready for review July 30, 2026 04:14
@Kikobeats
Kikobeats merged commit 890c429 into master Jul 30, 2026
2 checks passed
@Kikobeats
Kikobeats deleted the cursor/critical-bug-management-599a branch July 30, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants